package cn.mumzone.pos.api.service;


import java.util.List;

import cn.mumzone.basic.net.response.BaseResponse;
import cn.mumzone.basic.net.response.PageListResponse;
import cn.mumzone.pos.model.IntegralRoleEntity;
import cn.mumzone.pos.model.OffWorkSumAmountEntity;
import cn.mumzone.pos.model.LoginEntity;
import cn.mumzone.pos.model.OffWorkEntity;
import cn.mumzone.pos.model.OffWorkSumAmountResult;
import cn.mumzone.pos.model.OffWorkTicketEntity;
import cn.mumzone.pos.model.ShopUserEntity;
import cn.mumzone.pos.model.VerifyReturnAuthEntity;
import okhttp3.RequestBody;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Author Chaney
 * Date   2017/3/7 上午11:15.
 * EMail  qiuzhenhuan.hi@gmail.com
 */
public interface UserService {

    /**
     * 登录
     *
     * @param phone
     * @param pwd
     * @param code
     * @return
     */
    @FormUrlEncoded
    @POST("egg_basic/api/v1/pos/personal/login")
    Observable<Response<BaseResponse<LoginEntity>>> getUserInfo(
            @Field("phone") String phone, @Field("passWord") String pwd, @Field("code") String code);


    /**
     * 获取门店，是否换购，抵现
     *
     * @return
     */
    @POST("egg_market/api/v1/integral/getAllIntetralRuleInfo")
    Observable<Response<BaseResponse<IntegralRoleEntity>>> getAllIntegralRuleInfo();

    /**
     * 查询用户修改退货金额
     *
     * @param userId
     * @param userName
     * @param passWord
     * @return
     */
    @GET("egg_goods/api/v1.3/pos/personal/verifyReturnAuth")
    Observable<Response<BaseResponse<VerifyReturnAuthEntity>>> verifyReturnAuth(
            @Query("userId") String userId, @Query("userName") String userName, @Query("passWord") String passWord);


    /**
     * 门店导购列表
     *
     * @param pageNum
     * @param pageSize
     * @return
     */
    @GET("egg_basic/api/v1/pos/endBill/getShopUserList")
    Observable<Response<BaseResponse<PageListResponse<ShopUserEntity>>>> getShopUserList(
            @Query("pageNum") String pageNum, @Query("pageSize") String pageSize);


    /**
     * 交班金额汇总
     *
     * @return
     */
    @GET("egg_order/api/v1/pos/personal/handWorkSumAmount")
    Observable<Response<BaseResponse<OffWorkSumAmountResult>>> offWorkSumAmount();

    /**
     * 交班
     *
     * @param shopName
     * @param cashAmount
     * @return
     */
    @GET("egg_order/api/v1/pos/personal/shiftExchange")
    Observable<Response<BaseResponse<String>>> shiftExchange(
            @Query("shopName") String shopName, @Query("cashAmount") String cashAmount);

    /**
     * 修改密码
     *
     * @param originPwd
     * @param newPwd
     * @return
     */
    @FormUrlEncoded
    @POST("egg_basic/api/v1/pos/personal/updatePwd")
    Observable<Response<BaseResponse<String>>> updatePwd(@Field("originPwd") String originPwd, @Field("newPwd") String newPwd);


    /**
     * 获取用户排班权限
     *
     * @return
     */
    @GET("egg_goods/api/v1.4/pos/personal/getSchedulePermission")
    Observable<Response<BaseResponse<String>>> getSchedulePermission();


    /**
     * 获取交班记录
     *
     * @param startTime
     * @param endTime
     * @param key
     * @param pageNum
     * @param pageSize
     * @return
     */
    @FormUrlEncoded
    @POST("egg_order/api/v1/pos/across/getShiftListPage")
    Observable<Response<BaseResponse<PageListResponse<OffWorkEntity>>>> getShiftListPage(
            @Field("startTime") String startTime, @Field("endTime") String endTime, @Field("key") String key,
            @Field("pageNum") String pageNum, @Field("pageSize") String pageSize);


    /**
     * 获取交班详情
     *
     * @param id
     * @return
     */
    @GET("egg_order/api/v6/pos/across/getShiftRecordDetail")
    Observable<Response<BaseResponse<OffWorkTicketEntity>>> getShiftRecordDetail(@Query("id") String id);
}
